﻿namespace WMS6.Web.Billing
{
    using System;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class StatementQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnNew;
        protected Button btnSearch;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlStatementID;
        protected DropDownList ddlStatus;
        protected DropDownList ddlStatusOper;
        protected HtmlForm F9200;
        protected HtmlInputHidden hdnActionID;
        protected HtmlHead Head1;
        protected Label lblOwnerID;
        protected Label lblStatement;
        protected Label lblStatementID;
        protected Label lblStatus;
        protected HtmlLink mycss;
        protected ScriptManager ScriptManager1;
        protected TextBox txtOwnerID;
        protected TextBox txtStatementID;

        protected void btnList_Click(object sender, EventArgs e)
        {
            base.Server.Transfer(string.Format("StatementList.aspx?action={0}&from=list", base.UrlEncode(this.hdnActionID.Value.Trim())), false);
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("StatementList.aspx?action=" + this.hdnActionID.Value, false);
        }

        private void LoadDDl()
        {
            base.BindData2DDLBySysCode(this.ddlStatus, "StatementStatu");
            this.ddlStatus.Items.Insert(0, "");
            base.InitQueryDDL(this.ddlStatementID, 0);
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlStatusOper, 0);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadDDl();
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string StatementID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtStatementID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtStatementID.Text.Trim(), this.ddlStatementID.SelectedValue);
                }
                return "";
            }
        }

        public string Status
        {
            get
            {
                if (!string.IsNullOrEmpty(this.ddlStatus.SelectedValue.Trim()))
                {
                    return base.GetParamsString(this.ddlStatus.SelectedValue.Trim(), this.ddlStatusOper.SelectedValue);
                }
                return "";
            }
        }
    }
}

